Namespace System1
	Public Type Udt2
		s as String
	
	End Type
	Public Type Udt
		funcfoo() as Udt2
	
	End Type

	Public arr() as Udt
	Namespace Core
		Public Sub SubCall( ByVal x as Long, ByVal y as Long)
		
		End Sub
	
		Public Function tFunction(Optional ByVal x as Long , _
		Optional ByVal y as Integer="fgfg", _
		Optional ByVal z as Long) as Integer 
			Dim xd As Integer, yc As Double, xu As Integer
			Dim xxx() as long
			x = yc = 123
			Dim s As String
			x = "123" 
			Global.System1.arr(1,7).funcfoo(7,4).s=444
			
			Global.System1.Core.SubCall 7 , 8
			Exit Function

		End Function
	End Namespace
End Namespace
Public Type TestType
	var1 As Long
	var2 As String
	var3() As String
End Type

Public Type TestType2
	var1 As Long
	var2 As String
	var3() As TestType
End Type

Function Arraytest(g() As String) As String()
	On Error Resume Next
	Dim ff(1 to 9, 9 to 67) as String
	
	Dim MyStruct as TestType
	Dim MyStruct2 as TestType2
	
	MyStruct2.var2=MyStruct.var1
	
    ff(1, 9) = "its"
    ff(2, 55) = "working"
    Arraytest = ff
End Function

Function booltest() As Boolean

    Dim Arr(4, 4) As String
	Dim Arr2(1 to 9, 9 to 67) as String
    Dim s As String

    Dim ffft() As String
    ffft = Arraytest(Arr)

    s = Arr2(1, 9) '="its"
    s = Arr2(2, 55) '="working"


    Arr2(1, 9) = "wtf"
    Arr(4, 4) = "its my life"
    ReDim Preserve Arr(10, 67)

    s = Arr(4, 4)
    s = "12" + "99"

    s = Arr2(1, 9)

    booltest = 0
    Dim x As Long
    On Error Resume Next

    While x < 7
        x = x + 1

    Wend

    For x = 10 To 150 Step 10
        If x = 100 Then Exit For
    Next x

    Dim Y As Long
    factorial(x = 8)

    Do While x < 8
        x = x + 1
    Loop
    Do
        Y = x
        Exit Do
    Loop
    Do

    Loop Until x < 8



End Function

Function factorial(ByVal n As Long) As Long
    If (n <= 0) Then
        factorial = 1
    Else
        factorial = n * factorial(n - 1)
    End If  
End Function

Public Function ffftFunction(ByVal x as Long,Optional xg as Integer=0,Optional z as Long) AS String
    x = 5 + 7 * 8
    On Error GoTo LastLine
    x = System1.Core.tFunction(7, xg, 0)
    ffftFunction = "hello world"
    On Error GoTo LastLine
    If x > 0 Then x = x + "dd"
    GoTo LastLine
LastLine:
911:
    Resume Next
End Function

Private Function fact()
    Dim TokPrec As Integer, ExprPrec As Double, xu As Integer
    If TokPrec <> ExprPrec Then
        fact = (System1.Core.tFunction() = ".")
    ElseIf TokPrec <= ExprPrec Then

    Else
        fact = 0
    End If
    fact = 5 + 7 * 8
End Function